/**
 * Class for recieving JSON data from a specified url.
 * 
 * @constructor
 * @param {string} url The url of the data source
 * @returns An object including all recieved data
 */
function setJSONdata(url) {
    "use strict";
    var i, localVariable, readyVariable = {};
    //Get JSON data from a server
    $.ajax({
        url: url,
        dataType: 'json',
        async: false,
        success: function (data) {
            if (data !== null) {
                localVariable = data;
            }
        }
    });
    //Make just one object of the received data
    for (i in localVariable) {
        for(var j in localVariable[i]){
            readyVariable[j] = localVariable[i][j];
            readyVariable[localVariable[i][j].fin] = j;
        }
    }
    return readyVariable;
}